_package("css3.page");

_import("caf.ui.Page");
_import("caf.mui.ScrollView");

_class("HomePage", Page, function(){
	this._init = function(){
		_super._init.call(this);
    this._scrollview = null;
	};
	this.create = function(parent){
		var obj = this.createTplElement(parent, "home.xml");
		this.init(obj);
		return obj;
	};
	this.init = function(){
		_super.init.apply(this, arguments);
		this.initComponents();
		this.initActionElements();
    this._scrollview = new ScrollView(); //实例化scrollview类
    this._scrollview.bind($E("home_content_wrapper"), { //绑定scrollview对应的节点
        "parent": this,
        "id"    : "scroll1"
    });
    this.addListener(this._scrollview, "scrollEnd", this._scrollview, "onDefaultScrollEnd");//绑定默认的滚动结束事件

    this.initActionElements(this._self, this, ["div"]);

    if(navigator.onLine){
      alert("已联网");
    }

    if(window.postMessage){
      alert("支持postMessage")
    }

    if(window.WebSocket){
      alert("支持websocket")
    }

    if(typeof(Worker) != undefined){
      alert("支持Worker");
    }

    if(window.applicationCache){
      alert("支持离线应用");
    }
    if(navigator.geolocation){
      alert("支持地理位置信息");
    }
	};
	this.dispose = function(){
		_super.dispose.apply(this);
    this._scrollview.dispose();//释放scrollview对象
    this._scrollview = null;//清空
	};
  this.do_tran = function(){

  }
});